package externalflame.systemdesign.comment.exception;


import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class UniformExceptionAdvice {

    @ExceptionHandler(ResourceNotFoundException.class)
    public String handleResourceNotFoundException() {
        return "resource not found.";
    }

    @ExceptionHandler(AlreadyVoteException.class)
    public String handleAlreadyVoteException() {
        return "You have already vote for this comment.";
    }
}
